---
apiVersion: v1
kind: Secret
metadata:
  name: deckhouse-registry
  namespace: d8-{{ .Chart.Name }}
  {{- include "helm_lib_module_labels" (list .) | nindent 2 }}
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: {{ .Values.global.modulesImages.registry.dockercfg }}

{{- $namespaces := .Values.istio.internal.applicationNamespaces }}
{{- $namespaces = append $namespaces (printf "d8-%s" .Chart.Name) }} # d8-istio
{{- range $namespace := $namespaces }}
---
apiVersion: v1
kind: Secret
metadata:
  name: d8-istio-sidecar-registry
  namespace: {{ $namespace }}
  {{- include "helm_lib_module_labels" (list $) | nindent 2 }}
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: {{ $.Values.global.modulesImages.registry.dockercfg }}
{{- end }}

